package priv.mill.config;

import java.util.Map;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

//@ControllerAdvice
public class ErrorHandler {

	@ExceptionHandler(Exception.class)
	@ResponseBody
	public Object handerAll(Exception e) {
		return "赶紧给项目经理打电话，别睡了，再睡就天亮了！"+e.getClass();
	}
	
	@ExceptionHandler(NullPointerException.class)
//	@ResponseBody
	public String handerNullPoint(Exception e
			,Model model) {
		model.addAttribute("e", e);
//		map.put("e", e);
		return "error/null";  // error/null.jsp
	}
	
}
